Accelerated access to frames from a compressed digital video stream without keyframes

ABSTRACT

A digital video recorder stores digital video streams having sequences of encoded frames that are predominantly non-keyframes. The digital video recorder synthesizes keyframes for the digital video stream by decoding the frames in sequence and occasionally capturing the state of the decoder as it decodes the frames. The decoder states are stored in a state index in association with the frames. During playback at normal or accelerated speeds, the digital video recorder is capable of random accelerated access of any frame in the digital video stream. A decoder state associated with the accessed frame is retrieved from the state index and used to begin decoding at or near the accessed frame. The decoder state initializes a playback decoder to the state that enables complete decoding and rendering of the accessed frame without having to decode multiple frames previous to the accessed frame, thereby minimizing time delays in playback.

RELATED APPLICATIONS

This non-provisional U.S. patent application is a divisional of andclaims the benefit of priority to U.S. patent application Ser. No.10/227,573, filed on Aug. 22, 2002, the disclosure of which isincorporated by reference herein.

TECHNICAL FIELD

This invention relates to devices that handle digital video streams,such as digital video recorders. More particularly, this inventionrelates to techniques for recording and playing back digital videostreams that have limited or no keyframes.

BACKGROUND

A digital video stream is composed of a sequence of individual frames.Typically, the video stream has periodic keyframes. Each keyframecontains sufficient data to enable decoding and rendering of a completeimage. In the MPEG standard, an intra-frame is an example of a keyframe.To reduce the amount of data transmitted or stored, the digital videostream also typically is includes non-keyframes that contain lessinformation than is needed to decode and render a complete image.Non-keyframes are commonly inserted between keyframes and may contain,for example, information describing the motion of objects in therendered images. In the MPEG standard, an inter-frame (e.g., P-frame orB-frame) is an example of a non-keyframe. A full image cannot begenerated from a non-keyframe without first decoding a keyframe ormultiple preceding non-keyframes in the video stream.

FIG. 1 illustrates a conventional compressed digital video stream 100that includes a number of frames in sequence. Video stream 100 includesonly non-keyframes (e.g., inter-frames). Video stream 100 has nokeyframes (e.g., intra-frames). Video stream 100 is played by decodingthe frames in their decode order and rendering the frames in theirdisplay order. To play a particular frame, a number of previous framesare first decoded to enable decoding and rendering of a completelyspecified image at the particular frame. The number of preceding framesused to decode the particular frame is determined by the video encodingformat (e.g., MPEG 2, MPEG 4, H.26L, etc.) and the implementation of theencoder. For example, to decode and render non-keyframe 21 (referencedas frame 102 in FIG. 1) which resides in a digital video stream encodedusing the MPEG 2 standard, a decoder may need to decode the precedingtwenty non-keyframes 1-20 (are referenced generally as 104 in FIG. 1).

Playing back video streams with predominantly non-keyframes thus poses aproblem in that a large number of preceding frames must first be decodedbefore presentation of the desired frame. This results in aninconvenient time delay for a user who is waiting the view the recordedvideo stream.

A more challenging scenario is to play the video stream 100 at anaccelerated speed, such as fast forward or fast reverse. To play adigital video stream in an accelerated fast forward or fast reverse, aconventional recorder normally renders only the keyframes. Allnon-keyframes are skipped over. Unfortunately, for a digital videostream with limited or no keyframes, such as video stream 100,accelerated playback beginning at a selected frame in the stream isdifficult because there are no nearby previous keyframes from which acomplete image can be readily derived. Instead, each time the digitalvideo recorder wants to render a selected non-keyframe, it must firstdecode a large number of preceding non-keyframes.

For example, to render non-keyframe 21 in stream 100 at an acceleratedspeed, a position pointer is placed back in the stream to enabledecoding of many frames previous to the desired non-keyframe 21. In ourexample, the pointer may be placed as far back as non-keyframe 1 andthen the non-keyframes 1-20 are decoded in a sequential forward order toyield a completely specified decoded frame for the non-keyframe 21.

This accelerated playback involves a great amount of decoding resourcesto render images in the fast forward or fast reverse modes of operation.In some cases, accelerated playback at a desired frame-rate may beimpossible because the device playing the stream does not havesufficient resources to decode the necessary non-keyframes at thedesired frame-rate. Furthermore, decoding the large number of precedingframes in order to render the necessary non-keyframes results in anoticeable time delay between displayed frames. In some cases, this timedelay can be so great that it diminishes the effectiveness of a fastforward or fast reverse operation, which is supposed to be performed ata fast frame rate. At the very least, the delay can be annoying to theviewer.

FIG. 2 illustrates a conventional digital video recorder 200, which maybe used to decode digital video stream 100. The digital video recorder200 includes a source 202 that provides the compressed digital videostream 100 to a store 204, where the stream is recorded for playback ata later time.

A reader 206 retrieves individual frames of the video stream 100 fromthe store 204 and forwards them to a decoder 208. The video stream 100is read from the store 204 in a manner that streams the framessequentially to the decoder 208 as if they were being provided from thesource 202 in normal real-time play. The decoder 208 decodes the framesand forwards the decoded frames to a renderer 210 for rendering anddisplay to a user. The decoding process typically involvesdecompression, and hence decoders are also known as “decompressors”.

When the video recorder 200 is requested to access and decode aparticular frame in the stream 100, the reader 206 retrieves the framespreceding the particular frame from the store 204 and decodes thosepreceding frames at the decoder 208. Initially, the decompressed videoframes produced by the decoder 208 are incomplete because the firstdecompressed video frames also rely on data from preceding frames. Thefirst few decompressed video frames rely on an associated state of thedecoder that would have been built up in the decoder 208 had the decoderbeen decoding the frames in sequential order. But, by the time thedecoder reaches the intended frame, the decoder state is properly builtup to enable full decoding of the particular frame that results in acompletely specified image. Unfortunately, this delay in playback may bedisruptive to the viewer as he/she is forced to wait for the decoding ofpreceding frames before a renderable image is produced. Further, inaccelerated playback modes, the conventional recorder 200 may not evenbe able to decode all of the preceding frames in time to render theparticular frame at the desired frame-rate.

Accordingly, there is a need for improved decoder techniques that allowrendering of a video stream starting at a randomly accessed non-keyframewithout the time delays resulting from decoding frames previous to thenon-keyframe at the time of playing back the video stream.

SUMMARY

A digital video recorder stores digital video streams having sequencesof encoded frames that are predominantly non-keyframes. The digitalvideo recorder synthesizes keyframes for the digital video stream toenable prompt playback starting at any randomly accessed frame of therecorded digital video stream which has an associated synthesizedkeyframe. Synthesized keyframes are generated by decoding the frames insequence as the video stream is initially recorded and occasionallycapturing the state of the decoder as it decodes the frames. Thesynthesized keyframes can also be generated by decoding the frames insequence after the frames have been recorded and occasionally capturingthe state of the decoder as it decodes the frames. The decoder statesare stored in a state index in association with the frames.

During playback at normal or accelerated speeds, the digital videorecorder is capable of random accelerated access to any frame in thedigital video stream that is requested as a starting frame. When atarget frame is requested, a decoder state associated with the targetframe or a nearby prior frame is retrieved from the state index and usedto begin decoding at or near the target frame in the digital videostream. The decoder state effectively initializes a playback decoder tobegin decoding at or near the target frame without having to decode alarge number of frames preceding the target frame. In this way, thetarget frame is promptly decoded and rendered for viewing, withoutsignificant time delays.

BRIEF DESCRIPTION OF THE DRAWINGS

The same numbers are used throughout the drawings to reference likefeatures and components.

FIG. 1 illustrates a compressed digital video stream that includes asequence of non-keyframes.

FIG. 2 is a block diagram of a conventional digital video recorder thatcan be used to decode the video stream of FIG. 1.

FIG. 3 is a block diagram of digital video recorder with a keyframesynthesizer according to a first implementation in which keyframesynthesis is performed as a digital video stream is recorded.

FIG. 4 shows a portion of an exemplary digital video stream toillustrate how decoder states are captured and stored for use in thekeyframe synthesizer of FIG. 3.

FIG. 5 shows one specific example of a digital video stream encodedusing the MPEG 2 format to demonstrate capture of decoder states in anMPEG-compatible decoder.

FIG. 6 shows an exemplary process for capturing and storing decoderstates when decoding a video stream having no, or few, keyframes.

FIG. 7 shows the same video stream of FIG. 4, but slightly downstream,to illustrate how the decoder states are used to facilitate immediateplayback at normal or accelerated speeds starting at a randomly accessedframe.

FIG. 8 shows the same MPEG 2 video stream of FIG. 5, but duringplayback.

FIG. 9 shows an exemplary process for playing back a recorded digitalvideo stream having no, or few, keyframes.

FIG. 10 is a block diagram of digital video recorder with a keyframesynthesizer according to a second implementation in which the keyframesynthesis is performed as a background process.

FIG. 11 shows an exemplary process for capturing and storing decoderstates of one or more digital video streams in background while, inparallel, playing back the same or different recorded digital videostream.

DETAILED DESCRIPTION

A digital video recorder stores digital video streams for later playbackat times that are convenient for the viewer. The following discussionpertains to a digital video recorder that enables prompt and efficientplayback of digital video streams that are composed exclusively orprimarily of non-keyframes, meaning that the streams have either nokeyframes or relatively few keyframes. The recorder facilitatesaccelerated random access to particular decompressed frames withouthaving to first decode large sequences of frames preceding the desiredframes.

As used herein, keyframes are frames that contain sufficient data torender a complete digital image. In MPEG 2, for example, intra-frames orI-frames can be classified as keyframes. Conversely, non-keyframes areframes that contain less than sufficient data needed to fully render acomplete digital image. Non-keyframes might contain motion data or otherinformation that may be used to 1 render a complete image given one ormore preceding frames. In MPEG 2, for example, inter-frames such aspredicated or P-frames can be classified as non-keyframes.

The techniques described herein may be used with many digital videocoding formats, including MPEG 2, MPEG 4, H.26L, and so on. In someexamples, the MPEG 2 format is described for discussion purposes;however, the techniques are not limited to this specific format.

Exemplary Digital Video Recorder

FIG. 3 illustrates a digital video recorder 300 according to a firstimplementation in which keyframes are synthesized as an incoming digitalvideo stream is being recorded. The recorder 300 has a source 302 thatprovides a compressed video stream 100 having a sequence of frames. Thevideo stream 100 is composed exclusively or primarily of non-keyframes.The stream has either no keyframes, or relatively few keyframes. Moregenerally, the video stream 100 has fewer keyframes than are typicallyused to play the video stream at an accelerated speed and frame rate inthe forward or reverse direction.

The video stream 100 received from the source 302 is recorded in a store304. The store 304 may be configured, for example, as disk memory withsufficient capacity to hold one or more digital video streams. While thevideo stream is being recorded in the store 304, it is also passed to akeyframe synthesizer 306 which is capable of synthesizing keyframes thatmay be used for prompt playback of the digital video stream 100 from anynon-keyframe in the video stream. The keyframe synthesizer may beconfigured to synthesize keyframes for each and every non-keyframe, orfor less than all non-keyframes. During playback, decoding can beginfrom any particular non-keyframe for which there is a synthesizedkeyframe. Additionally, prompt playback can be achieved from othernon-keyframes that are close to and subsequent to the particularnon-keyframe by decoding a small number of intervening non-keyframes.

A synthesized keyframe may be as simple as a representation of theproperly decoded form of the associated frame, or it may be as complexas a representation of the entire state of the decoder including allcurrently active reference frames. The term “synthesized keyframe” isnot intended to imply that the synthesized keyframe contains only datafor the decompressed frame. The synthesized keyframe may be representedin a number of different ways that are all equivalent in terms ofallowing the decoder to resume decoding at or near the location of theassociated frame. All such representations are within the scope of thisinvention.

The keyframe synthesizer 306 has a decoder 308 to decode the frames fromthe video stream 100. Occasionally, during decoding, a decoder state 310of the decoder 308 is captured and stored in a state index 312. Thestate index 312 may employ its own separate memory to store the decoderstates, or use a portion of the store 304.

In general, the decoder state 310 represents the state of the decoder308 at an arbitrary point in time when decoding consecutive frames ofthe video stream 100. The state of the decoder is built up over timefrom decoding the frames in sequence. The state may be captured justbefore, or just after, decoding the associated frame. Each decoder state310 essentially describes the state of the decoder 308 after decodingall preceding frames and at a point just prior to, or just after,decoding the corresponding frame so that the decoder state, whenre-loaded at the time of playback, enables full and complete renderingof the corresponding frame, but before decoding of the next frame. Forinstance, the states may contain reference data accumulated in referencebuffers of the decoder after decoding a series of frames. Alternatively,the decoder states may include representations of fully decompressedframes. In another implementation, individual decoder states may includearbitrary data from the associated frame. Arbitrary data can beessentially any piece of data from a frame, and is implementationdependent. For example, the frame type is a piece of arbitrary data froma frame.

Whether the decoder state is captured just before or just after decodeof the associated frame is a matter of design choice. If the decoderstate is captured before decode of the associated frame, then decode ofthat frame during playback occurs after loading the decoder state.Conversely, if the decoder state is captured after decoding theassociated frame, then the frame is merely output during playbackwithout further decoding. Once a timing is decided upon, the keyframesynthesizer consistently stores that type of state (i.e., pre-frame orpost-frame) in the state index. Theoretically, although perhaps not aspractical, the decoder state can alternatively be captured at some pointmidway through decoding the associated frame.

Decoder states may be captured in different ways. For example, thedecoder 308 may be configured to output the decoder states for eachframe, or for every N^(th) frame (where N>1). Alternatively, the stateindex 312 may be configured to request states from the decoder 308. Asanother alternative, the decoder 308 may be equipped with a statereading component that reads and outputs decoder states on a periodic oran as-requested basis.

Decoder states 310 can be associated with corresponding frames. Theassociation may be accomplished through the data structure of the stateindex. The frames corresponding to the decoder states may be identifiedusing different parameters including, for example, unique frame numbers,an offset value of the frame within the digital video stream, or atimestamp of the frame.

As noted above, individual decoder states may include representations offully decompressed frames. In this situation, the state index mayutilize lossless or lossy image compression and/or image scaling whenstoring the decoder states. If lossy image compression is used, someimage data contained in the decoder's reference buffers is lost. As aresult, the state index effectively stores image data that, whenreconstructed, results in a lower quality image than the original imagefrom which it is derived. However, such data is still considered validrepresentations of the original reference buffers from which they came.

In terms of keyframe synthesis, the decoder state 310 providessubstantially the same information as a keyframe for purposes ofdecoding. The decoder state 310 is complete to the extent that, whenloaded into a decoder, will allow immediate decoding to resume at ornear an associated frame in the video stream 100 without having todecode a large number of preceding frames that would otherwise need tobe decoded to build up the decoder state. By allowing decoding to resumenear the associated frame, rather than precisely at the associatedframe, the state index 312 can flexibly contain fewer decompressedframes when the recorder 300 is used with some compressed video formats.

For playback of the recorded video streams, the digital video recorder300 includes a reader 314 to retrieve frames of the video stream 100from the store 304. The frames are passed to a playback decoder 316,which decodes the frames and passes the decoded frames to a renderer 318for rendering of displayable images. The reader 314 may be configured tocoordinate and control the operation of the playback components.Although only one reader and one playback decoder are shown, the digitalvideo recorder can be equipped with multiple readers and playbackdecoders that operate concurrently.

The playback decoder 316 is coupled to the keyframe synthesizer 306 toreceive synthesized keyframes that may be used when decoding randomlyaccessed frames in the store 304. For instance, suppose the recorder 300receives a user request to start decoding at a particular target framesomewhere in a video stream. The reader 314 accesses the target framefrom the store 304 and passes it to the playback decoder 316. Theplayback decoder 316 also asks the state index 312 for a decoder state310 that is associated with the target frame or with a preceding frameproximal to the target frame. The state index 312 locates and retrievesan appropriate decoder state 310. This retrieval may be based on variouscharacteristics of the compressed frames in the stream, including butnot limited to, the order (or ordinal) of the frames in the videostream, offset values of the frames within the video stream, andtimestamps associated with the frames.

The retrieved decoder state 310 is loaded into the decoder 316 so thatthe decoder may be placed in the same state that it would otherwise havebeen in had it decoded the sequence of frames preceding the targetframe. If the decoder state corresponds directly with the target frame,the playback decoder 316 uses the loaded state to begin decoding thetarget frame immediately. The decoder 316 is thus able to output acompletely specified decompressed digital video frame for renderingwithout any delay.

On the other hand, if the decoder state is associated with a precedingframe proximal to the target frame, the playback decoder 316 beginsdecoding at the proximal frame and continues with any interveningframe(s) until it reaches and decodes the target frame. In oneimplementation, where the target frame does not have an associateddecoder state, the recorder 300 employs a position pointer to identifythe nearest preceding frame in the video stream 100 that has anassociated decoder state. The decoder begins decoding at the identifiedproximal frame and advances sequentially through the frames until thetarget frame is decoded. At this point, the decoder 316 has built up theproper state to enable output of a completely specified decompressedtarget frame.

It is noted that the number of frames between the target frame and thenearest proximal frame associated with the decoder state is less thanthe number of frames that would need to be decoded if the decoder had tobegin building up the entire state from scratch. Accordingly, even whenthe recorder begins decoding near the target frame instead of at thetarget frame, the recorder 300 is still able to output displayableimages without significant delay. Additionally, in this situation, thedecoder state of the playback decoder 316 at the time of decoding thetarget frame may be captured and recorded in the state index 312 forfuture use.

Accordingly, the digital video recorder 300 with keyframe synthesizer306 enables random access to and rendering of any non-keyframe in thestream 100. The resulting decompressed frames are available for use innormal playback, fast forward, fast rewind, and/or seek operations. Infast forward and rewind modes, the state index 312 can be used toachieve fast frame rates that are not possible with conventionaltechniques, which require decoding of all or many preceding frames foreach displayed frame. By loading pre-captured decoder states, theplayback recorder is capable of quickly generating a series of framesfor display in fast forward or fast reverse. To make fast forward orfast reverse frame rates as high as possible, the recorder mayintelligently choose to generate only frames having correspondingdecoder states in the state index 312.

It is noted that not all compressed frames necessarily have acorresponding decoder state stored in the state index. Recording adecoder state for each frame involves more processing and memoryresources, but enables very efficient playback at both normal andaccelerated rates. In implementations where such resources are notavailable, the keyframe synthesizer 306 may capture fewer decoder statesthan the number of frames. A small and coarse state index is easilymanageable, but limits the number of positions in the stream to whichthe state index allows quick access. This can cause lack of accuracywhen the user skips around, and low frame rate at slower speeds of fastforward and rewind. One suitable tradeoff is to capture and store onedecoder state in the state index for every second of video stream.

The decoding capabilities of the digital video recorder vary dependingupon implementation criteria. The recorder may be configured to supportonly one decode operation at a time, permitting either decoding of thestream as it arrives 11 using decoder 308 or decoding the stream duringplayback using playback decoder 316. In such an implementation, a singledecoder may be used to perform the tasks of decoder 308 and playbackdecoder 316. Alternatively, the recorder 300 may be configured withadequate resources to accommodate real-time decoding at decoder 308 ofone or more streams being recorded in store 304 from source 302, whilesimultaneously supporting real-time decoding of streams stored in store304 by playback decoder 316. Another implementation of the digital videorecorder is described below with reference to FIG. 10.

Capturing Decoder States in Non-Keyframe Video Stream

FIG. 4 shows a portion of an exemplary video stream 400 to illustratehow decoder states can be captured and stored in the state index. Thevideo stream 400 has either exclusively non-keyframes, or predominantlynon-keyframes with a few keyframes. The non-keyframes represent anarbitrary sequence of frames in the stream 400, but they are labeledsequentially from 1 to 21 for referencing purposes. As the recorder 300receives the video stream 400, the frames are passed to the decoder 308of the keyframe synthesizer 306. The decoder 308 decodes the frames asthey arrive.

Suppose, for example, the decoder 308 is currently decoding non-keyframe21, as indicated by the pointer 402. Prior to this frame, the decoder308 has decoded several previous non-keyframes, such as the precedingtwenty non-keyframes 1-20, as represented by reference number 404.Having decoded the preceding non-keyframes 1-20 and the currentnon-keyframe 21, a valid image for the current frame 21 is producedwithin the decoder 308. The decoder's state just after decoding ofnon-keyframe 21 is captured and stored in the state index 312. Thisdecoder state for non-keyframe 21 is represented as “DS 21”. The stateindex 312 maintains an association between the decoder state 310 forframe 21 and the non-keyframe 21 from which the decoder state iscaptured. This association may be achieved in many ways including, forexample, storing a reference pointer to the associated frame or storinga frame identifier (e.g., a frame ordinal number, an offset value of theframe in the stream, a timestamp of the frame, etc.) in relation to thedecoder state. The decoder state for frame 21 enables the decoder,during playback, to resume decoding at the non-keyframe 21 withouthaving to re-decode the preceding frames.

FIG. 5 shows one specific example of a video stream 500 that is encodedin the MPEG 2 format. The stream 500 has multiple P-frames, representedby frames P1 through P14, and B-frames interleaved between sequentialpairs of P-frames. When the stream is passed to decoder 308 of keyframesynthesizer 306, proper decoding of P-frame P9 (referenced as number502) depends on decoding a previous sequence of frames in sequentialorder, such as sequence 504 encompassing P-frames P2-P8. P-frames do notdepend on the interleaved B-frames, so the decoder 308 disregards theB-frames in sequence 504.

Assuming the decoding begins at P-frame P2, the decoder 308 does notgenerate a valid image for any of the individual frames P2-P8. However,a valid image for P-frame P9 is nonetheless produced within the decoderwhen the decoder finishes decoding P-frame P9 after having decoded theentire sequence 504. After decoding P-frame P9, but before decoding thenext B-frame B17, the state of decoder 308 is captured and stored in thestate index 312. This decoder state for P-frame P9 is represented inFIG. 5 as “DS P9”. When the stream is subsequently played back in normalor accelerated modes, this state allows decoding to resume at or nearP-frame P9 without having to decode the entire sequence 504.

A decoder state for P-frame P10 (i.e., DS P10) can be captured andstored after decoding the preceding sequence 506 of P-frames P3-P9. Ifthe preceding frames P2-P9 have already been decoded to produce acomplete image for P-frame P9, the decoder 308 need only decode the nextP-frame P10 in order to produce a complete image and generate a suitabledecoder state DS P10.

It is noted that although sequences of seven preceding frames are shownin FIG. 5, the number of frames needed to produce a complete imagevaries depending upon the encoder implementation, encoder configuration,and coding format. Additionally, while B-frames need not be decoded togenerate and store decoder states for the P-frames, the B-frames can bedecoded if they are desired for some other purpose, such as display.

Each compressed P-frame in the stream has a portion that does not relyon any other data in order to decode correctly, and a portion thatrelies on previously correctly decoded data to decode correctly.Portions of the P-frame that do not rely on previously decoded datadecode correctly assuming the video stream is not corrupted. Portions ofthe P-frame that do rely on previously decoded data decode correctly ifthat previously decoded data itself is decoded correctly. Morespecifically, if decoding starts at a particular P-frame, the particularP-frame and subsequent P-frames help to fill in the video rendered ontoa visual display screen. Often, the non-dependent portions of a seriesof P-frames form a regular repeating pattern that fully paints the videowith valid data that does not depend on previous data.

FIG. 6 shows an exemplary process 600 for capturing and storing decoderstates when decoding a video stream having no, or few, keyframes. Theprocess will be described with reference to the implementation of thedigital video recorder 300 described in FIG. 3. The process 600 isimplemented in any suitable hardware, software, firmware, or combinationthereof. In the case of software and firmware, process 600 represents aset of operations that may be implemented as computer-executableinstructions stored in memory that can be executed by one or moreprocessors.

At block 602, a compressed digital video stream having predominantlynon-keyframes is received from source 302. Generally, the number ofkeyframes in the compressed video stream, if any, is insufficient toperform operations at accelerated speeds, such as fast forward and/orfast reverse. At block 604, the video stream is stored in store 304.

At block 606, the non-keyframes of the compressed video stream arepassed to the keyframe synthesizer 306 and decoded at decoder 308. Thedecoding can be performed previous to, concurrently with, or afterstorage of the associated frames of the stream in store 304. The decoder308 exhibits different decoder states as frames are decoded, and thedecoder state changes as each frame is decoded.

At block 608, the keyframe synthesizer occasionally captures the decoderstate 310 of the decoder 308. The decoder state may represent the exactstate of the decoder after decoding a corresponding frame, or it mayrepresent a decoder state that will allow decoding to resume at or nearthe corresponding frame when the state is reloaded into the decoder. Thedecoder state may be taken after decoding each frame, or on a lessfrequent basis. The decoder state may be captured periodically, or on amore arbitrary basis. As one example, the decoder state is captured forevery second of video at normal play speed. This means that the decoderstate is saved approximately once every 30 frames in the compressedvideo stream.

At block 610, the decoder state is stored in the state index 312 inassociation with its corresponding frame. This association may beaccomplished via a table structure, pointers, or some other indexingtechnique.

Prompt Playback at Accessed Frame Using Decoder States

FIG. 7 shows the same video stream 400 of FIG. 4, but slightlydownstream, to illustrate how decoder states in the state index are usedto facilitate immediate playback at normal or accelerated speeds whenstarting at a randomly accessed frame in the store. This portion of thevideo stream 400 has been previously stored in store 304 and associateddecoder states for this portion of the stream have been captured andstored in state index 312. The video stream 400 may be stored in wholeor in part in the store 304.

As an example of storing part of a video stream, digital video recordersare capable of simultaneously playing back one portion of a video streamwhile recording another portion of the video stream. For instance, auser may be “delayed” in a live program. The recorder continues torecord the live program while concurrently playing back the recordedportions from the playback point. The user may fast forward to catch upto the live program.

Now, suppose the user requests to begin playback at non-keyframe 21, asreferenced by the playback decoder pointer 702. The reader 312 ofrecorder 300 accesses the non-keyframe 21 in store 304 and passes it tothe playback decoder 316. The decoder state DS 21 associated withnon-keyframe 21 is also extracted from the state index 312 and loadedinto the playback decoder 316. Recall that the decoder state DS 21represents the state of decoder 308 taken after it decoded the precedingnon-keyframes 1-20 and non-keyframe 21. The captured decoder state thusrepresented a complete valid image for the non-keyframe 21. Accordingly,with this state, the playback decoder 316 is able to immediately outputnon-keyframe 21 to the renderer 318 for rendering and display to theuser. The recorder may then continue with decoding non-keyframe 22 andfollowing frames, if desired.

In this example, the decoder state is captured after decoding theassociated keyframe. Alternatively, the decoder state DS21 can becaptured just before the decoder 308 decodes non-keyframe 21. In thiscase, the decoder state DS21 represents the state of decoder 308 takenafter it decoded the non-keyframes 1-20 preceding non-keyframe 21. Withthis state, the playback decoder is able to immediately decodenon-keyframe 21 into a complete image that can be passed to the renderer318.

In this manner, the keyframe synthesizer 306 essentially synthesizes akeyframe to enable prompt playback of any randomly accessed frame. Inour example, the video stream does not have a keyframe precedingnon-keyframe 21. But, by loading the state index previously capturedwhen decoding the non-keyframe 21 during recording, the recorder is ableto synthesize a keyframe just prior to the non-keyframe 21 so thatplayback can begin immediately without the delay of decoding manypreceding frames.

It is noted that non-keyframe 21 may not have an associated decoderstate in state index 312. In this case, the reader extracts the closestprior frame that has an associated decoder state in the state index. Forexample, suppose non-keyframe 17 is the closest prior frame. The decoderstate associated with non-keyframe 17 is loaded in playback decoder 316and the decoder begins decoding the video stream beginning atnon-keyframe 17. The decoder then continues decoding all frames betweennon-keyframe 17 and non-keyframe 21. Upon reaching non-keyframe 21, thedecoder is able to output a completely specified image. The decoder maythen continue to decode subsequent frames, if desired.

As noted above, the keyframe synthesizer may employ lossy compressionwhen storing states in the state index. If the state index uses lossycompression, the image reconstructed upon decoding the non-keyframe 21(assuming it has an associated decoder state, or if not, the nextclosest non-keyframe 17 with an associated decoder state) may not be ofthe highest quality desired. That is, with lossy compression, someinformation is lost, which may adversely degrade quality of theresulting image. There is thus a tradeoff between the resourceconservation achieved using lossy compression of the decoder states andimage quality of the image reconstructed from the stored decoder states.

If lossy compression is used, the recorder may be configured to fullyreconstruct the frame in background and substitute it for the lowerquality image. For instance, suppose the user “pauses” the recorder onthe frame of lower image quality. The recorder decodes a series ofpreceding frames in background to produce a high-quality reconstructionand then replaces the paused low-quality image with the high-qualityimage.

FIG. 8 shows the same MPEG 2 video stream 500 as recorded in FIG. 5. Tobegin playback at P-frame P9 without having to first decode P-frames P2through P8 (i.e., sequence 504), the decoder state corresponding toP-frame P9 is loaded from the state index 312 into the playback decoder316, enabling the decoder to decode and output a complete image fromdecoded P-frame P9. Decoding can then continue forward with P-frame P10.

It is noted that in conventional MPEG 2 decoding where no states arestored and loaded, P-frame P9 is not output to the renderer untilP-frame P10 is decoded. In contrast, the playback decoder 316 inrecorder 300 is able to output P-frame P9 as soon as the associatedstate is loaded. This has no significant effect when resuming playbackat P-frame P9, but the distinction is noted for purposes of discussingfast forward and rewind below.

Playback operations that require a high frame rate, such as fast forwardand rewind, are achieved by repeated use of a process on each frame inthe fast forward or rewind operation. To use P-frame P9 as one frame ofa fast forward or rewind sequence, the decoder state corresponding toP-frame P9 is loaded from the state index and the decoder is set to thatstate. The playback decoder may or may not automatically output P-frameP9. If the playback decoder does not automatically output P-frame P9,the playback decoder can be induced to output P-frame P9 by using anappropriate technique for the specific decoder type. One appropriatetechnique is to present the P-frame P10 to the decoder. Anotherappropriate technique is to present a synthesized (“replacement” or“fake”) P-frame to the decoder. Another technique is to call to anapplication program interface (API) of the decoder that instructs thedecoder to output P-frame P9.

FIG. 9 shows an exemplary process 900 for playing back a recordeddigital video stream having no, or few, keyframes. The process will bedescribed with reference to the implementation of the recorder 300described in FIG. 3. The process 900 is implemented in any suitablehardware, software, firmware, or combination thereof. In the case ofsoftware and firmware, process 900 represents a set of operations thatmay be implemented as computer-executable instructions stored in memorythat can be executed by one or more processors.

At block 902, the reader 314 accesses the compressed digital videostream in store 304 and reads a particular target frame from whichplayback is requested. Playback may be requested for normal oraccelerated speeds. The accessed frame is passed to the playback decoder316. At block 904, the decoder state associated with the accessed frameis loaded from the state index 312 into the playback decoder 316. Thisstate sets the playback decoder to essentially the same state it wouldhave built up by decoding preceding frames in the video stream.

At block 906, the playback recorder 316 either outputs the frame withoutfurther decoding (e.g., in the case where the state was captured justafter decoding the associated frame) or decodes the accessed frame usingthe decoder state to produce a completely specified image that can berendered (e.g., in the case where the state was captured just prior todecoding the associated frame). At block 908, the decoded frame ispassed to renderer 318 for rendering and display to the user. As aresult, the decoder state effectively functions as a synthesizedkeyframe in that it sets the playback decoder 316 to the appropriatestate to enable production of a complete image from decoding of anon-keyframe, even where no prior frames have been decoded.

It is noted that the frame from which playback is requested may not havea corresponding decoder state in the state index. In this situation, thereader may access a preceding frame that has an associated decoder stateand begin decoding at that point. The recorder then continues decodingframe-by-frame until reaching the requested frame. Once the requestedframe is decoded, it can be output for rendering and display.

Digital Video Recorder with Background Keyframe Synthesis

FIG. 10 illustrates another implementation of a digital video recorder1000 in which the keyframe synthesis is performed in background. In thisimplementation, a compressed digital video stream 100 from source 302 isrecorded in the store 304 without concurrently being passed to thekeyframe synthesizer. As before, the video stream 100 is composedexclusively or predominantly of non-keyframes, so that the stream haseither no keyframes or relatively few keyframes.

The recorder 1000 has a keyframe synthesizer 1002 connected to the store304. The keyframe synthesizer 1002 is capable of synthesizing keyframesthat may be used for normal or accelerated playback of the digital videostream 100 starting at any non-keyframe in the stream. In the FIG. 10implementation of the recorder 1000, the keyframe synthesizer 1002derives decoder states for various streams in store 304 using abackground process.

More specifically, the keyframe synthesizer 1002 has a background reader1004 that reads individual frames from the store 304. The backgroundreader 1002 can randomly access selected frames from any video stream inthe store 304. The background reader 1004 passes each retrieved frame toa background decoder 1006, which decodes the frame. Occasionally, duringthe decoding, a decoder state 310 of the background decoder 1006 at thepoint of decoding a frame is captured and stored in a state index 312.The decoder state 310 is stored in association with the frame from whichit is derived and represents the state of the background decoder at thetime of processing that frame. The decoder state 310 need not be theexact decoder state prior to or after decoding the corresponding frame;but, can be a state that will allow decoding to resume at or near thecorresponding frame when the state is reloaded into the playbackdecoder. The state index 312 may employ its own separate memory to storethe decoder states, or use the store 304.

Since this process occurs in background, the keyframe synthesizer 1002maintains a notion of which frames ought to be in the state index 312for every digital video stream in store 304. For example, such a notioncould be even divisibility of the number of frames in the stream by somevalue N (e.g., N=30). In this case, a decoder state 310 is captured forevery N^(th) frame of video stream 100. If at any point the backgrounddecoder 1006 correctly decodes an N^(th) frame that should be in thestate index but is not, a decoder state associated with that frame isadded to the state index. It is noted that any new decoder statesderived by the playback decoder 316 during playback may also be added tothe state index 312.

The digital video recorder 1000 also includes a playback reader 314 toretrieve frames of the video stream 100 from the store 304 duringplayback at normal or accelerated speeds. The frames are passed to aplayback decoder 316, which during normal playback decodes the framesand passes the decoded frames to a renderer 318 for rendering.

The playback decoder 316 is coupled to the keyframe synthesizer 1002 toreceive synthesized keyframes that may be used when decoding frames inthe video stream 100. When the recorder 1000 is requested to startdecoding at a particular target frame, the playback decoder 316 requeststhe state index 312 to provide the decoder state 310 associated with thetarget frame or with a frame proximal to the target frame.

The state index 312 locates and retrieves the decoder state 310, whichis then loaded into the playback decoder 316 so that the decoder may beplaced in the same state that it would otherwise have been in had itdecoded the sequence of frames preceding the target frame. The reader314 accesses the target frame from the store 304 and passes it to theplayback decoder 316. If the state corresponds directly with the targetframe, the playback decoder 316 uses the loaded state to is begindecoding the target frame immediately. If the state is associated with ais frame proximal to the target frame, the playback decoder 316 beginsdecoding at the proximal frame and continues decoding frames in sequenceuntil it reaches the target frame. In this situation, a decoder stateassociated with the target frame can be captured and stored for futureuse. In either case, the decoder 316 outputs a completely specifieddecompressed digital video frame for rendering without any delay. Thedecompressed digital video frames are available to be used in normalplayback, fast forward, rewind, and seek operations of the video stream100.

Since the keyframe synthesizer 1002 operates in the background, it canwork on one or more video streams at a time. These streams can becurrently recording streams or streams that have been previouslyrecorded.

In another implementation, the functions of the playback decoder 316 andthe background decoder 1006 are performed by the same decoder. Thesingle decoder and store have a finite amount of resources that can beallocated for either playback operations or background operations.Playback operations usually take precedence, so the amount of resourcesavailable for building state indexes in background can range from zero(if playback is using all resources) to fall (if no playback isoccurring). If no unused resources are available, the single decoderdoes not perform any state index work of the background decoder 1006,although some state index work associated with a currently playingstream may be given sufficient priority to be accomplished. However,when extra unused resources are available, the resources are used tocomplete the state index for video streams that have incomplete stateindexes.

The selection of which streams are worked on is a matter ofimplementation detail. In one implementation, video streams that arecurrently playing and nearest 18 to reaching a point where their decoderstate index is incomplete and a next state is needed are assignedhighest priority. Additionally, decoding of a video data stream can beinterrupted and resumed as priorities for the decoder resources change.Priorities for processing video streams might change, for example, whena higher priority video stream becomes available or when the decodingresources are used for playback operations.

When a stream is selected for background processing, the reader readsthe stream and the single decoder begins performing the tasks of thebackground decoder 1006. The decoder begins decoding at a position inthe stream that sufficiently precedes the first needed position in orderto obtain a valid decoder state for that position in the stream.Decoding proceeds onward from this point and decoder states are capturedoccasionally as desired. The keyframe synthesizer may skip over sectionsof the stored video stream that are deemed unnecessary for constructionof the state index 312 when the desired decoder states are sufficientlyfar apart.

If fast forward, rewind, seeking, or any other operation is performed bythe user and no decoder states are available for the requested sectionof the stream, the recorder 1000 generates appropriate decoder states onthe fly and stores them in the state index. This can be performed, forexample, by the playback decoder configured to use conventionaltechniques to decode an entire sequence of preceding frames to produce acompletely decoded frame. The reader then prompts the playback decoderto create decoder states for the requested section of the video stream.The decoder states are stored in the state index as they are generated.This mode of operation is similar to how a system without a state indexwould operate, the difference being that decoder states are stored andretained in the state index for the next time the user requests suchoperations. In this way, after the first fast forward or rewind over asection is achieved using conventional decoding techniques without useof decoder states, subsequent fast forwards or rewinds over the samesection of video can be achieved more quickly and efficiently using thenewly captured decoder states.

FIG. 11 shows an exemplary process 1100 for capturing and storingdecoder states of one or more digital video streams in background while,in parallel, playing back the same or different recorded digital videostream. The streams have few or no keyframes. The process 1100 will bedescribed with reference to the implementation of the recorder 1000described in FIG. 10. The process is implemented in any suitablehardware, software, firmware, or combination thereof. In the case ofsoftware and firmware, process 1000 represents a set of operations thatmay be implemented as computer-executable instructions that can beexecuted by one or more processors.

At block 1102, a compressed digital video stream having predominantlynon-keyframes is received from source 302. At block 1104, the videostream is stored in store 304. At this point, the process branches totwo paths of operations—playback operations (e.g., normal speedplayback, fast forward, rewind, seek, etc.) and synthesis operations(e.g., capturing and storing decoder states)—that may be performed inparallel. If the digital video recorder 1000 is equipped with tworeaders and two decoders, these operations may be performedsimultaneously. Conversely, if the recorder 1000 is equipped with onereader and one decoder, these resources are used to perform the playbackoperations as requested, and to perform the synthesis operations inbackground when resources are available.

With respect to the synthesis operations, at block 1106, the backgroundreader 1004 of keyframe synthesizer 1002 selects and reads one of thecompressed video streams in store 304. At block 1108, non-keyframes ofthe compressed video stream are passed to background decoder 1006. Thedecoder state is built up in the background decoder 1006 as frames aredecoded.

At block 1110, decoder states 310 of the background decoder 1006 areoccasionally captured. The decoder state may represent the exact stateof the decoder after decoding a corresponding frame, or it may representa decoder state that will allow decoding to resume at or near thecorresponding frame when the state is reloaded into the decoder. Thedecoder state may be taken after decoding each frame, or on a lessfrequent basis. As one example, the decoder state is for every N^(th)frames (e.g., N=30). At block 1112, the decoder state is stored in thestate index 312, or other storage location. The decoder state ispreferably stored in association with the frame that the decoder justdecoded, or will be decoding immediately next, when the state wascaptured. This association may be accomplished via a table structure,pointers, or some other indexing technique.

With respect to the playback operations, at block 1120, the playbackreader 314 accesses a requested digital video stream in store 304 andreads the frames beginning at a point where playback is requested. Theaccessed frame is passed to the playback decoder 316. At block 1122, thedecoder state associated with the accessed frame is loaded from thestate index 312 into the playback decoder 316. This state sets theplayback decoder to essentially the same state it would have built up bydecoding preceding frames in the video stream.

At block 1124, the playback recorder 316 either outputs the framewithout further decoding (e.g., in the case where the state was capturedjust after decoding 1 the associated frame) or decodes the accessedframe using the decoder state to produce a completely specified imagethat can be rendered (e.g., in the case where the state was capturedjust prior to decoding the associated frame). At block 1126, the decodedframe is passed to renderer 318 for rendering and display to the user.It is noted that the frame from which playback is requested may not havea corresponding decoder state in the state index. In this situation, thereader may access a preceding frame that has an associated decoder stateand begin decoding at that point. The recorder could then continuedecoding frame-by-frame until reaching the requested frame. Once therequested frame is decoded, it can be output for rendering and display.

Conclusion

Although the invention has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the invention defined in the appended claims is not necessarilylimited to the specific features or acts described. Rather, the specificfeatures and acts are disclosed as exemplary forms of implementing theclaimed invention.

The invention claimed is:
 1. A method comprising: recording a digitalvideo stream having encoded video frames; capturing one or more decoderstates that represent states of a decoder when decoding one or moreassociated video frames; creating a state index for the digital videostream, the state index storing the one or more decoder states; playingback the digital video stream by using a particular decoder state in thestate index to begin decoding at or near a target video frame in thedigital video stream from which playback is requested; pausing thedigital video stream and rendering a video frame associated with theparticular decoder state such that a lower quality image is depicted;and decoding video frames preceding the video frame associated with theparticular decoder state to produce a higher quality image andsubstituting the higher quality image for the lower quality image.
 2. Amethod as recited in claim 1, wherein the recording, the capturing andthe creating are performed concurrently.
 3. A method as recited in claim1, wherein the one or more decoder states are captured at every Nthvideo frame in the digital video stream, wherein N>1 and N is less thana total number of frames in the digital video stream.
 4. A method asrecited in claim 1, wherein the digital video stream is played back atnormal speed by decoding and rendering the video frames in the digitalvideo stream starting with the video frame associated with theparticular decoder state.
 5. A method as recited in claim 1, wherein thedigital video stream is played back at an accelerated speed by decodingand rendering the video frames having associated decoder states in thestate index.
 6. A method as recited in claim 3, wherein N is less than anumber of frames necessary to decode a valid image.
 7. A method asrecited in claim 5, wherein the playback is in a forward direction.
 8. Amethod as recited in claim 5, wherein the accelerated speed is in areverse direction.
 9. A method as recited in claim 1, wherein the one ormore decoder states are captured once for every second of the digitalvideo stream played back at normal speed.
 10. A method as recited inclaim 1, wherein the one or more decoder states are captured once forevery thirty frames in the digital video stream.
 11. One or morecomputer-readable storage media devices, storing and having fixedthereon computer-executable instructions that, when executed by one ormore processors, cause the one or more processors to perform actscomprising: recording a digital video stream having encoded videoframes; capturing one or more decoder states that represent states of adecoder when decoding one or more associated video frames, wherein thecapturing is based at least in part on a frame rate required foraccelerated playback; creating a state index for the digital videostream, the state index storing the one or more decoder states; playingback the digital video stream by using a particular decoder state in thestate index to begin decoding at or near a target video frame in thedigital video stream from which playback is requested; pausing thedigital video stream and rendering a video frame to display a lowerquality image; decoding video frames preceding the video frame toproduce a higher quality image; and substituting the higher qualityimage for the lower quality image.
 12. The one or more computer-readablestorage media devices as recited in claim 11, wherein the recording, thecapturing, and the creating are performed concurrently.
 13. The one ormore computer-readable storage media devices as recited in claim 11,wherein the one or more decoder states are captured at every Nth videoframe in the digital video stream, where N>1 and N is less than a totalnumber of frames in the digital video stream.
 14. The one or morecomputer-readable storage media devices as recited in claim 13, whereinN is less than a number of frames necessary to decode a valid image. 15.The one or more computer-readable storage media devices as recited inclaim 11, wherein the digital video stream is played back at normalspeed by decoding and rendering the video frames in the digital videostream starting with the video frame associated with the particulardecoder state.
 16. The one or more computer-readable storage mediadevices as recited in claim 11, wherein the digital video stream isplayed back at an accelerated speed by decoding and rendering the videoframes having associated decoder states in the state index.
 17. Adigital video recorder comprising: a store configured to receive adigital video stream having encoded video frames; a keyframe synthesizerfor capturing one or more decoder states that represent states of adecoder when decoding one or more associated video frames; a state indexfor the digital video stream, the state index storing the one or moredecoder states; a playback decoder to play the digital video streambased at least in part on a particular decoder state in the state index,wherein the playback decoder is configured to: pause the digital videostream and render the video frame associated with the particular decoderstate such that a lower quality image is depicted; decode a series ofvideo frames preceding the video frame associated with the particulardecoder state to produce a higher quality image; and substitute thehigher quality image for the lower quality image.
 18. A digital videorecorder as recited in claim 17, wherein the playback decoder plays backthe digital video stream at normal speed by decoding and rendering thevideo frames in the digital video stream starting with the video frameassociated with the particular decoder state.
 19. A digital videorecorder as recited in claim 17, wherein the playback decoder plays backthe digital video stream at an accelerated speed by decoding andrendering the video frames having associated decoder states in the stateindex.
 20. A digital video recorder as recited in claim 17, wherein thekeyframe synthesizer captures the one or more decoder states at everyNth video frame in the digital video stream, wherein N>1, N is less thana total number of frames in the digital video stream, and N is less thana number of frames necessary to decode a valid image.